<?php
namespace Tbf\Bundle\UpyunBundle\Tests;
use Tbf\Component\FileSystem\FileSystemFunction;
class UploadTest extends TestCase
{
    protected $kernel;

    public function setUp()
    {
        $this->markTestIncomplete();
        $this->save_path = $this->getParameter('kernel.cache_dir').'/test/upyun_upload/';
        FileSystemFunction::delete($this->save_path);
    }
    public function tearDown()
    {
        FileSystemFunction::delete($this->save_path);
    }
    public function testUploadListFromPhp()
    {
        $this->get('tbf_upyun')->uploadListFromPhp(array(
            '/3.txt',
            '/test/2.txt'
        ),'/test/',__DIR__.'/'.'Fixture');
        $this->get('tbf_upyun')->downloadListFromPhp(array(
            '/test/3.txt',
            '/test/test/2.txt'
        ),$this->save_path);
        $this->assertEquals('bcd',file_get_contents($this->save_path.'/test/3.txt'));
        $this->assertEquals('chd',file_get_contents($this->save_path.'/test/test/2.txt'));

    }
}
